package com.gaohe.scp.mapper;

import java.util.List;
import com.gaohe.scp.domain.CsCarSituation;
import org.apache.ibatis.annotations.*;

/**
 * 车况信息Mapper接口
 *
 * @author liuxiangyu
 * @date 2025-03-25
 */
@Mapper
public interface CsCarSituationMapper
{

    public CsCarSituation selectCsCarSituationByCarId(Long carId);

    /**
     * 查询车况信息
     *
     * @param situationId 车况信息主键
     * @return 车况信息
     */
    public CsCarSituation selectCsCarSituationBySituationId(Long situationId);

    /**
     * 查询车况信息列表
     *
     * @param csCarSituation 车况信息
     * @return 车况信息集合
     */
    public List<CsCarSituation> selectCsCarSituationList(CsCarSituation csCarSituation);

    /**
     * 新增车况信息
     *
     * @param csCarSituation 车况信息
     * @return 结果
     */
    public int insertCsCarSituation(CsCarSituation csCarSituation);

    /**
     * 修改车况信息
     *
     * @param csCarSituation 车况信息
     * @return 结果
     */
    public int updateCsCarSituation(CsCarSituation csCarSituation);

    /**
     * 删除车况信息
     *
     * @param situationId 车况信息主键
     * @return 结果
     */
    public int deleteCsCarSituationBySituationId(Long situationId);

    /**
     *
     * 批量删除车况信息
     * @param situationIds 需要删除的数据主键集合
     * @return 结果
     */
    public int deleteCsCarSituationBySituationIds(Long[] situationIds);

    @Delete("delete from cs_car_situation where car_id = #{carId}")
    int deleteCsCarSituationByCarId(Long carId);

    /**
     * 作者:张文豪
     * @param carId
     * @return
     */
//    @Select("SELECT situation_id, car_id, content, paifang_stand, color, novel, gearbox, power_type, power " +
//            "FROM cs_car_situation " +
//            "WHERE car_id = #{carId}")
//    @Results({
//            @Result(property = "situation_id", column = "situationId"),
//            @Result(property = "paifangStand", column = "paifang_stand"),
//            @Result(property = "powerType", column = "power_type")
//    })
//    CsCarSituation selectCsCarSituationByCarId(Long carId);

    /**
     * 作者:张文豪
     * @param csCarSituation
     * @return
     */
    int updateAllCarInfo(CsCarSituation csCarSituation);

    List<CsCarSituation> selectCsCarSituationListByCarId(Long carId);
}
